$(function(){
	var mainAdImages = $(".bigbn-4").find("img");
	var nmDialog = $(".nomember-order-end").find("img");
	var lazyLoadImages = $("img").not(mainAdImages).not(nmDialog);
	var imageDomain = $("#imageDomain").val();
	lazyloadByObjectReference(lazyLoadImages, imageDomain + "/images/none1.gif");//default placeholder

	//預載圖片
	$('img', $('.arrowarea')).each(function(){
		$(this).attr('src', $(this).attr('original'));
	});
	$('img', $('.sub-menu')).each(function(){
		$(this).attr('src', $(this).attr('original'));
	});
})

function lazyloadImagesUnderBlockByClassName(className, placeholderUrl) {
	var target = $("." + className).find("img");
	lazyloadByObjectReference(target, placeholderUrl);
}

function lazyloadByObjectReference(target, placeholderUrl) {
	target.lazyload({
		placeholder : placeholderUrl
		,failurelimit : 300
	});
}

